<template>
	<view class="xy-box">
		<view class="xy-list">
			<view class="xy-list-item" @tap="showAgreementInfo(1)">
				<text class="xy-list-item-text">用户协议</text>
				<image class="xy-list-item-icon" src="/static/right_gray_icon.png" mode="aspectFit"></image>
				<view class="xy-list-item-line"></view>
			</view>
			<view class="xy-list-item" @tap="showAgreementInfo(2)">
				<text class="xy-list-item-text">隐私政策</text>
				<image class="xy-list-item-icon" src="/static/right_gray_icon.png" mode="aspectFit"></image>
				<view class="xy-list-item-line"></view>
			</view>
			<view class="xy-list-item" @tap="showAgreementInfo(3)">
				<text class="xy-list-item-text">CFCA数字证书服务协议</text>
				<image class="xy-list-item-icon" src="/static/right_gray_icon.png" mode="aspectFit"></image>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {app_user_agreement,app_user_privacy,app_user_cfca} from '@/config/config.js'
	//查看协议信息
	const showAgreementInfo = (type)=>{
		if (type == 1) {
			uni.navigateTo({
				url: `/pages/webview/webview?title=用户协议&url=${app_user_agreement()}`
			})
		}
		else if (type == 2) {
			uni.navigateTo({
				url: `/pages/webview/webview?title=隐私政策&url=${app_user_privacy()}`
			})
		}
	    else {
			uni.navigateTo({
				url: `/pages/webview/webview?title=CFCA数字证书服务协议&url=${app_user_cfca()}`
			})
		}
	}
</script>

<style lang="scss" scoped>
.xy-box{
	padding: 30rpx;
	.xy-list{
		border-radius: 15rpx;
		background-color: white;
		.xy-list-item{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 30rpx;
			height: 100rpx;
			font-size: 28rpx;
			color: $xh-title-color;
			position: relative;
			.xy-list-item-icon{
				width: 24rpx;
				height: 24rpx;
			}
			.xy-list-item-line{
				position: absolute;
				left: 30rpx;
				right: 30rpx;
				bottom: 0;
				height: 1px;
				background-color: $xh-line-color;
				transform: scaleY(0.5);
			}
		}
	}
}
</style>
